package cn.tedu.binary;

public class Demo02 {
    public static void main(String[] args) {
        /**
         * 验证右移位: 每移动一次，数字除以2
         */
        int n = 100;
        System.out.println(n);
        System.out.println(Integer.toBinaryString(n));
        System.out.println(n>>1);
        System.out.println(Integer.toBinaryString(n>>1));
        System.out.println(n>>2);
        System.out.println(Integer.toBinaryString(n>>2));

        n = -100;
        System.out.println(n);
        System.out.println(Integer.toBinaryString(n));
        System.out.println(n>>1);
        System.out.println(Integer.toBinaryString(n>>1));
        System.out.println(n>>2);
        System.out.println(Integer.toBinaryString(n>>2));


    }
}
